/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.mailbox.Metadata;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SetConfig
/*    */   extends RedoableOp
/*    */ {
/*    */   private String mSection;
/*    */   private String mConfig;
/*    */   
/*    */   public SetConfig()
/*    */   {
/* 37 */     super(MailboxOperation.SetConfig);
/* 38 */     this.mSection = "";
/* 39 */     this.mConfig = "";
/*    */   }
/*    */   
/*    */   public SetConfig(int mailboxId, String section, Metadata config) {
/* 43 */     this();
/* 44 */     setMailboxId(mailboxId);
/* 45 */     this.mSection = (section == null ? "" : section);
/* 46 */     this.mConfig = (config == null ? "" : config.toString());
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 50 */     StringBuffer sb = new StringBuffer("section=").append(this.mSection);
/* 51 */     sb.append(", config=").append(this.mConfig.equals("") ? "null" : this.mConfig);
/* 52 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 56 */     out.writeUTF(this.mSection);
/* 57 */     out.writeUTF(this.mConfig);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 61 */     this.mSection = in.readUTF();
/* 62 */     this.mConfig = in.readUTF();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 66 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 67 */     mbox.setConfig(getOperationContext(), this.mSection, this.mConfig.equals("") ? null : new Metadata(this.mConfig));
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/SetConfig.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */